<?php
namespace Common\Controller;
use Common\Controller\CommonController;
use Think\Cache\Driver\Redis;

class LyricistController extends CommonController
{

    /**
     * 缓存题库
     */
    public function cachequestion($time=3600)
    {
        $question = M('lyricist_question')->select();

        $list      =   array();
        $number_1       =   array();
        $number_2       =   array();
        $number_3       =   array();
        $number_4       =   array();
        $number_5       =   array();
        if (! empty($question))
        {
            foreach ($question as $key=>$value)
            {
                $value['title'] = json_decode($value['title']);
                $value['answer'] = json_decode($value['answer']);
                $list[$value['id']]    =   $value;

                switch ($value['number'])
                {
                    case 1:
                        $number_1[] =   $value;
                        break;

                    case 2:
                        $number_2[] =   $value;
                        break;

                    case 3:
                        $number_3[] =   $value;
                        break;

                    case 4:
                        $number_4[] =   $value;
                        break;

                    case 5:
                        $number_5[] =   $value;
                        break;
                }
            }
        }

        S('lyricist_question',$list,$time);
        S('lyricist_question1',$number_1,$time);
        S('lyricist_question2',$number_2,$time);
        S('lyricist_question3',$number_3,$time);
        S('lyricist_question4',$number_4,$time);
        S('lyricist_question5',$number_5,$time);

    }

    /**
     * 获取题目
     */
    public function getquestion($member_id,$time,$appid){

        $list = S('lyricist_question');
        if (empty($list)){
            $this->cachequestion();
        }

        $question1 = S('lyricist_question1');
        $question2 = S('lyricist_question2');
        $question3 = S('lyricist_question3');
        $question4 = S('lyricist_question4');
        $question5 = S('lyricist_question5');

        $data = array();

        $data[0] = $question1[array_rand($question1)];
        $data[1] = $question2[array_rand($question2)];
        $data[2] = $question3[array_rand($question3)];
        $data[3] = $question4[array_rand($question4)];
        $data[4] = $question5[array_rand($question5)];

        foreach ($data as $key=>$val){

                $question[$val['id']] = $val['index'];

        }

        $insert = array(
            'uid'=>$member_id,
            'create_time'=>$time,
            'anwser'=>json_encode($question),
            'appid'=>$appid,
            'state'=>0,
        );

        M('lyricist_questions_played')->data($insert)->add();

        return $data;

    }

    /**
     *根据好友数判断
     * @param $uid
     */
    public function updatetag($uid,$money_total,$play_num){

        if (empty($play_num)){
            $play_num = 10;
        }

        if (!empty($money_total)){

            $create_time = M('lyricist_cash')->where(array('uid'=>$uid))->order('id desc')->getField('create_time'); //领取时间
            if ($create_time){
                $whreshare['createtime'] = array('egt',$create_time);
            }
            $whreshare['my_member_id'] =   $uid;
            $sharenum = M('lyricist_relationship')->where($whreshare)->count();

            if ($money_total>2.75&&$money_total<3.85){

                if (empty($sharenum)){
                    $play_num =  6;
                }elseif ($sharenum>0&&$sharenum<5){
                    $play_num =  8;
                }

            }

            if ($money_total>=3.85&&$money_total<4.55){

                if (empty($sharenum)){
                    M('lyricist_member')->where(array('uid'=>$uid))->save(array('tag'=>'5'));  //羊毛党
                    $play_num =  2 ;
                }elseif ($sharenum<12){
                    $play_num =  5 ;
                }

            }

            if ($money_total>=4.55){
                if ($sharenum<7){
                    M('lyricist_member')->where(array('uid'=>$uid))->save(array('tag'=>'5'));  //羊毛党
                    $play_num =  2 ;
                }
            }

        }

        return $play_num;

    }

    /**
     * 生成红包
     */
    public function create_redbag($uid,$appid,$game_id)
    {

        $money_total = M('lyricist_member')->where(array('uid'=>$uid))->getField('money_total'); //当前奖金


        if (!empty($money_total))
        {
            if ($money_total<2.75){
                $red_total = rand(20,25) / 100; //奖金
                if ($money_total<0.48){
                    $red_total = rand(48,68) / 100; //奖金
                }
            }else{

                $create_time = M('lyricist_cash')->where(array('uid'=>$uid))->order('id desc')->getField('create_time'); //领取时间
                if ($create_time){
                    $whreshare['createtime'] = array('egt',$create_time);
                }
                $whreshare['my_member_id'] =   $uid;
                $sharenum = M('lyricist_relationship')->where($whreshare)->count();

                if ($money_total<3.3){
                    if (empty($sharenum)){
                        $red_total = rand(1,2) / 100; //奖金
                    }elseif ($sharenum>0&&$sharenum<5){
                        $red_total = rand(3,5) / 100; //奖金
                    }elseif ($sharenum>=5){
                        $red_total = rand(15,25) / 100; //奖金
                    }

                }else{

                    if ($money_total<3.85){
                        if (empty($sharenum)){  //黑名单
                            $red_total = 0.01;
                        }elseif ($sharenum<9){
                            $red_total = rand(3,5) / 100; //奖金
                        }elseif ($sharenum>=9){
                            $red_total = 0.1;
                        }
                    }elseif ($money_total<=4.55){
                        if ($sharenum<=5){ //黑名单
                            $red_total = 0.01;
                        }elseif ($sharenum>5&&$sharenum<=9){
                            $red_total = 0.03;
                        }elseif ($sharenum>=9){
                            $red_total = rand(15,25) / 100; //奖金
                        }

                    }elseif ($money_total>4.55&&$money_total<5){
                        if ($sharenum<7){
                            $red_total = 0.01;
                        }elseif ($sharenum<12){
                            $red_total = rand(1,2) / 100; //奖金
                        }elseif ($sharenum>=12){
                            $red_total = rand(15,25) / 100; //奖金
                        }
                    }elseif ($money_total>=5){
                        $red_total = 0.01;
                    }

                }


            }


        }
        else
        {
            $red_total = rand(48,68) / 100; //奖金
        }

        $insert_data                =   array();
        $insert_data['member_id']   =   $uid;
        $insert_data['red_total']   =   number_format($red_total, 2);
        $insert_data['status']      =   0;
        $insert_data['create_time'] =   date('Y-m-d H:i:s');
        $insert_data['total_sn']    =   $this->create_order();
        $insert_data['time']        =   time();
        $insert_data['appid']        =   $appid;
        $insert_data['game_id']        =   $game_id;

        $result     =    M('lyricist_redbag')->add($insert_data);
        if (! empty($result))
        {
            $insert_data['challenge_id']    =   $result;
            $this->create_redbag_log($insert_data);
            $this->create_change_log($insert_data);
        }
        return  $result;
    }


    //生成红包记录
    private function create_redbag_log($insert_data)
    {
        $insert_data['create_time'] =   date('Y-m-d H:i:s');
        $insert_data['time']        =   time();
        M('lyricist_redbag_log')->add($insert_data);
    }

    //生成收支记录
    private  function create_change_log($insert_data)
    {
        //添加一条收入记录
        $insert_change_log                  =   array();
        $insert_change_log['game_id']       =   $insert_data['game_id'];
        $insert_change_log['member_id']     =   $insert_data['member_id'];
        $insert_change_log['red_total']     =   '+'.$insert_data['red_total'];
        $insert_change_log['status']        =   0;
        $insert_change_log['create_time']   =   $insert_data['create_time'];
        $insert_change_log['from_sn']       =   $insert_data['total_sn'];
        $insert_change_log['type_id']       =   1;
        $insert_change_log['status_text']   =   '现金红包';
        $insert_change_log['time']          =   time();
        $insert_change_log['appid']       =   $insert_data['appid'];

        M('lyricist_change_log')->add($insert_change_log);
    }

    /**
     * 生成订单
     */
    private function create_order()
    {
        $order_id           =   'HB'.date('YmdHis').rand(100000,999999);
        $where              =   array();
        $field              =   array('challenge_id');
        $where['total_sn']  =   $order_id;
        $resutl             =   M('lyricist_redbag')->where($where)->field($field)->find();
        if (empty($resutl))
        {
            return  $order_id;
        }
        else
        {
            $this->create_order();
        }
    }

    /**
     * 缓存排行数据
     */
    public function cacherank($appid){

        $redis = new Redis();

        $name = 'lyricist_rank'.$appid;
        $cache = $redis->get($name);
        if ($cache){
           return $cache;
        }


        $filed1 = array('total_money','nickname','avatarurl','uid');
        $where['appid'] = $appid;
        $data = M('lyricist_member')->field($filed1)->where($where)->order('total_money desc')->limit(20)->select();

        $arr[] = array(
            'total_money'=>'31.15',
            'nickname'=>'熟悉的人',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/z2VficlQBuZpzlcFZvYiaiaScLC4z8oJaC7tjiblgFX3k65XGWiaBfp4icu0ztNa8yJFo6Hpo3JN5VcFMLrp9Mv7ZfSA/132'
        );

        $arr[] = array(
            'total_money'=>'30.45',
            'nickname'=>'林资柳',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/FlwGibsYGEUNlSUE8NMUTOyicZyncYTsKnKTMiahx6RiavGFibK4aKMqHzfm5J5SjsG7d4uL0VQ2WktUm2odj1NNdwA/132'
        );

        $arr[] = array(
            'total_money'=>'29.65',
            'nickname'=>'焕然一新',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/EXt78tjhHxf9ZiatU1Q4iaeiaZdmZPSFt4MUGt27jzduTNfsLpqHEsHfZh69LU36x4oKqVicgU0ufDE9laZdB9icBcg/132'
        );

        $arr[] = array(
            'total_money'=>'28.88',
            'nickname'=>'安静',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/PKTwH7TOvDFFibiaRLE2sNiaibfCiam3YiaCxOGJ8iagZ1IViaAW2pnIRicYWsrU3G8ljvy9eht5qL8Hy8ohXVt6IFUbDkA/132'
        );

        $arr[] = array(
            'total_money'=>'28.32',
            'nickname'=>'深情不及久伴',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/tVp0VhCWGyswkD8pMlJ2YA4emqUlg1GuDPQACucVmYQvTgVj34VA82Ser6j7J2h8G84Mwd4dUI3GTozPo0nSicA/132'
        );

        $arr[] = array(
            'total_money'=>'27.63',
            'nickname'=>'水冰月',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/4m4vGLOpWN28ibsOAbIUV46m4xeHULRAThagwTwjyMTYhiaEibMpMFA6CCjm4KWOg6sDiaAcibkRFVHnRe8zXodWpmQ/132'
        );

        $arr[] = array(
            'total_money'=>'27.23',
            'nickname'=>'小污妹~',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/znQXeSW0sl46bwCyZbZjcYf9ATbgwic17nPZCwId9qgjXRSpjIfp1ibMVRy3Bn19Y5rqDNtibmczLQKJNyDf31tkg/132'
        );

        $arr[] = array(
            'total_money'=>'26.76',
            'nickname'=>'胡睿睿',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/THrs5eNib88zXo6IzOJqUG6ngZryNgj0pdFAH7MGcbFRmvrMTDWOMZRzJOrlh5NL5n9DzgU9sD0yu8Ua6OTJ4FQ/132'
        );

        $arr[] = array(
            'total_money'=>'25.13',
            'nickname'=>'人生如戏',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/gjnbYxvB26ibghialNK87MjRtlI6KjIClXBQkaV3miavXOlJJVTUmMyygpHRxbmNrDvczPUmDN4cBeJl6z712qciaA/132'
        );

        $arr[] = array(
            'total_money'=>'23.34',
            'nickname'=>'幸福的我',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/1ED9JXFSdJgwia4HIuF4s7TPoJ9xKJBHnXVl4yqZbB0QSLGdVEam5XvLhf3V08XR393IT1PwPHxh3eKtY3O9diag/132'
        );


        $arr[] = array(
            'total_money'=>'22.18',
            'nickname'=>'张博涵妈妈',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83epfYCqjeUUHdadzqlibyicLSDylllaVCdNhFcGJYwh3Mr1Of12at3sK0L9PDwhTkYB0bj0kQxkglevQ/132'
        );

        $arr[] = array(
            'total_money'=>'21.37',
            'nickname'=>'自由自在',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/IicH2WIKxfLNt2AhEDEdpKNRW6kApLB6rDfEG8mOpR65Vgb4oRU81LhqqdTBAwXx53XkfRMngxNucKnSicfaawIw/132'
        );

        $arr[] = array(
            'total_money'=>'20.65',
            'nickname'=>'笑对人生',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/KMc3ic26tfHomiaov8Vv5icJDzodibRkAsCia46icbzAc9jnacZcv1e4icWbFica6fUH66Q4Ric6QXp5SJXBRkyR9aIalsA/132'
        );

        $arr[] = array(
            'total_money'=>'19.08',
            'nickname'=>'A.YANG',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/r678e0l92ogicnKH2fdSQEU5GsViaZxQVkS2xlhZyFakDCMMGE9vZB6Pr89nronYJ9IhQJibHy1NjY0AzrBoxAu7w/132'
        );

        $arr[] = array(
            'total_money'=>'18.32',
            'nickname'=>'寒芷星韵',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/BCIyymNXUd2ERkNfGGRbjiaySnFZLxsgK6SZL5VLeFG1ibyo1RT9NH51iaZNPdouE98fjlVibUVoldznUicHS1glficg/132'
        );

        $arr[] = array(
            'total_money'=>'17.63',
            'nickname'=>'痞子的笑',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/EIwRRxnVptNXaduw9S8gtj3RKiaYuFjbEa9IvopDZsEctzFxKpDgp135kcDjs64nAicbZEialzaNu5SeXyqPk90NA/132'
        );

        $arr[] = array(
            'total_money'=>'16.25',
            'nickname'=>'简单的幸福',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJ0yJDRjA1S5PXnNoh25OzhGG2rVydeu3luYQ7jXian6Vkodj1Zg7sLQZHicib3bfhnhAEpcqCCzjKfw/132'
        );

        $arr[] = array(
            'total_money'=>'15.76',
            'nickname'=>'健康铭妹',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/eszmWrowibhUEbGHYteAxsL3SmXIcY6NAAYO7LIuRibnNX6sy2gQUAtJhqqGicbKnpmyn4YMPu9NHHSJJztfHJp0g/132'
        );

        $arr[] = array(
            'total_money'=>'14.13',
            'nickname'=>'张芷歌',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKnXqrCwxoUGukibWbCD8ArLxYaUXJUqCFcYdGhcbUkP4Bf6LPRKVbFAh3P5Cskyqp7uu0Avq1134w/132'
        );

        $arr[] = array(
            'total_money'=>'13.34',
            'nickname'=>'红提之乡',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/UgFkFShR3a9LibvLDmicvaUicMsxDdXLBuDbCmt8ENCjZVzU7biaJFsmO2foQMrelyaWice7ChSlpu15N5tOQ3hOnHg/132'
        );


        $arr[] = array(
            'total_money'=>'13.18',
            'nickname'=>'MJH',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/PF4S4naHQIRVKJsYLqUQ88lMk5rURW2aCYSXCrjtEyBdkicmG0EG0PicyicTwBJhYWCOl1XxBWlu8GnV0qbn39QpA/132'
        );

        $arr[] = array(
            'total_money'=>'12.37',
            'nickname'=>'星在线',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/IicH2WIKxfLNt2AhEDEdpKNRW6kApLB6rDfEG8mOpR65Vgb4oRU81LhqqdTBAwXx53XkfRMngxNucKnSicfaawIw/132'
        );

        $arr[] = array(
            'total_money'=>'11.49',
            'nickname'=>'笑对人生',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/KMc3ic26tfHomiaov8Vv5icJDzodibRkAsCia46icbzAc9jnacZcv1e4icWbFica6fUH66Q4Ric6QXp5SJXBRkyR9aIalsA/132'
        );

        $arr[] = array(
            'total_money'=>'11.08',
            'nickname'=>'A.YANG',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/r678e0l92ogicnKH2fdSQEU5GsViaZxQVkS2xlhZyFakDCMMGE9vZB6Pr89nronYJ9IhQJibHy1NjY0AzrBoxAu7w/132'
        );

        $arr[] = array(
            'total_money'=>'10.82',
            'nickname'=>'Superman',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/gHluXVXRkz3EA1OzSQQFdrf7KoLAQCl1iaqFic1JKszEzfPEib6lcwIdGDGA2zs4ouzdAFolrrWBHX30g76T0n0BQ/132'
        );

        $arr[] = array(
            'total_money'=>'10.23',
            'nickname'=>'林泽楠',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83eotEDGibMU4f1nv9OC4QV2EjBDtD3NWDdiaDFJVs7pG6V1YyhvtAX0NiceiazvEHAYoQ9V7y7eT2vcDHw/132'
        );

        $arr[] = array(
            'total_money'=>'9.75',
            'nickname'=>'努力奋斗',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83eowB44AADB37M5UBWrkY1IC6trjB6xaemjTejIdscOwc3tAeu0EKgIbb5Uy3DpErhBliak55YDjAmA/132'
        );

        $arr[] = array(
            'total_money'=>'8.86',
            'nickname'=>'随遇而安',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/mRtBlsicVuErqIAibYwk97Vfe3R33bZhzCv3EcFjPS9AKudjTo6RqqzgerRJ6WHlBS1XJJmOAsYGclQs2vh8iaLLw/132'
        );

        $arr[] = array(
            'total_money'=>'7.13',
            'nickname'=>'流年若景',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/ic7CadZv0meH8BoVL9tnZKszUTShIUKOTDXyZHicib8TvRByicxOKwDBp1E9dQtpYG0zsZdUKnDZ3nDgvYkQsufCEQ/132'
        );

        $arr[] = array(
            'total_money'=>'6.94',
            'nickname'=>'好日子',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTI7gvy1l62mEfYrcQPrPwIxia88m2Z1Q28hCl0gcywmOLTK5kWyf366iayF5wicaqeLvVod71NnoStibg/132'
        );


        foreach ($data as $val){
            $arr[] = $val;
        }

         $len = count($arr);
            for ($k=0;$k<$len;$k++){
                for ($j=0;$j<$len-$k;$j++){
                    if ($arr[$j]['total_money']<$arr[$j+1]['total_money']){
                        $tem = $arr[$j];
                        $arr[$j] = $arr[$j+1];
                        $arr[$j+1] = $tem;
                    }
                }

            }

       $redis->set($name,$arr,600);
        return $arr;
    }

    /**
     * 缓存提现信息
     */
    public function cachecash($appid){


        $redis = new Redis();

        $cache = $redis->get('lyricist_cash');

        if ($cache){
            return $cache;
        }

        $field                          =   array('nickname','avatarurl','money');
        $where_cash_log['cash_status']  =   array('EGT','0');
        $where_cash_log['appid']  =   $appid;
        $where_cash_log = array_filter($where_cash_log);
        $result   =   M('lyricist_cash')->where($where_cash_log)->field( $field )->select();


        $arr[] = array(
            'money'=>'10.00',
            'nickname'=>'熟悉的人',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/z2VficlQBuZpzlcFZvYiaiaScLC4z8oJaC7tjiblgFX3k65XGWiaBfp4icu0ztNa8yJFo6Hpo3JN5VcFMLrp9Mv7ZfSA/132'
        );

        $arr[] = array(
            'money'=>'10.00',
            'nickname'=>'林资柳',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/FlwGibsYGEUNlSUE8NMUTOyicZyncYTsKnKTMiahx6RiavGFibK4aKMqHzfm5J5SjsG7d4uL0VQ2WktUm2odj1NNdwA/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'非常霸道',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/EXt78tjhHxf9ZiatU1Q4iaeiaZdmZPSFt4MUGt27jzduTNfsLpqHEsHfZh69LU36x4oKqVicgU0ufDE9laZdB9icBcg/132'
        );

        $arr[] = array(
            'money'=>'10.00',
            'nickname'=>'安静',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/PKTwH7TOvDFFibiaRLE2sNiaibfCiam3YiaCxOGJ8iagZ1IViaAW2pnIRicYWsrU3G8ljvy9eht5qL8Hy8ohXVt6IFUbDkA/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'深情不及久伴',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/tVp0VhCWGyswkD8pMlJ2YA4emqUlg1GuDPQACucVmYQvTgVj34VA82Ser6j7J2h8G84Mwd4dUI3GTozPo0nSicA/132'
        );

        $arr[] = array(
            'money'=>'10.00',
            'nickname'=>'水冰月',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/4m4vGLOpWN28ibsOAbIUV46m4xeHULRAThagwTwjyMTYhiaEibMpMFA6CCjm4KWOg6sDiaAcibkRFVHnRe8zXodWpmQ/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'小污妹~',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/znQXeSW0sl46bwCyZbZjcYf9ATbgwic17nPZCwId9qgjXRSpjIfp1ibMVRy3Bn19Y5rqDNtibmczLQKJNyDf31tkg/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'胡睿睿',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/THrs5eNib88zXo6IzOJqUG6ngZryNgj0pdFAH7MGcbFRmvrMTDWOMZRzJOrlh5NL5n9DzgU9sD0yu8Ua6OTJ4FQ/132'
        );

        $arr[] = array(
            'money'=>'10.00',
            'nickname'=>'人生如戏',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/gjnbYxvB26ibghialNK87MjRtlI6KjIClXBQkaV3miavXOlJJVTUmMyygpHRxbmNrDvczPUmDN4cBeJl6z712qciaA/132'
        );

        $arr[] = array(
            'money'=>'10.00',
            'nickname'=>'幸福的我',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/1ED9JXFSdJgwia4HIuF4s7TPoJ9xKJBHnXVl4yqZbB0QSLGdVEam5XvLhf3V08XR393IT1PwPHxh3eKtY3O9diag/132'
        );


        $arr[] = array(
            'money'=>'10.00',
            'nickname'=>'张博涵妈妈',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83epfYCqjeUUHdadzqlibyicLSDylllaVCdNhFcGJYwh3Mr1Of12at3sK0L9PDwhTkYB0bj0kQxkglevQ/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'自由自在',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/IicH2WIKxfLNt2AhEDEdpKNRW6kApLB6rDfEG8mOpR65Vgb4oRU81LhqqdTBAwXx53XkfRMngxNucKnSicfaawIw/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'笑对人生',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/KMc3ic26tfHomiaov8Vv5icJDzodibRkAsCia46icbzAc9jnacZcv1e4icWbFica6fUH66Q4Ric6QXp5SJXBRkyR9aIalsA/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'A.YANG',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/r678e0l92ogicnKH2fdSQEU5GsViaZxQVkS2xlhZyFakDCMMGE9vZB6Pr89nronYJ9IhQJibHy1NjY0AzrBoxAu7w/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'寒芷星韵',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/BCIyymNXUd2ERkNfGGRbjiaySnFZLxsgK6SZL5VLeFG1ibyo1RT9NH51iaZNPdouE98fjlVibUVoldznUicHS1glficg/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'痞子的笑',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/EIwRRxnVptNXaduw9S8gtj3RKiaYuFjbEa9IvopDZsEctzFxKpDgp135kcDjs64nAicbZEialzaNu5SeXyqPk90NA/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'简单的幸福',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJ0yJDRjA1S5PXnNoh25OzhGG2rVydeu3luYQ7jXian6Vkodj1Zg7sLQZHicib3bfhnhAEpcqCCzjKfw/132'
        );

        $arr[] = array(
            'money'=>'10.00',
            'nickname'=>'健康铭妹',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/eszmWrowibhUEbGHYteAxsL3SmXIcY6NAAYO7LIuRibnNX6sy2gQUAtJhqqGicbKnpmyn4YMPu9NHHSJJztfHJp0g/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'张芷歌',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKnXqrCwxoUGukibWbCD8ArLxYaUXJUqCFcYdGhcbUkP4Bf6LPRKVbFAh3P5Cskyqp7uu0Avq1134w/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'红提之乡',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/UgFkFShR3a9LibvLDmicvaUicMsxDdXLBuDbCmt8ENCjZVzU7biaJFsmO2foQMrelyaWice7ChSlpu15N5tOQ3hOnHg/132'
        );


        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'MJH',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/PF4S4naHQIRVKJsYLqUQ88lMk5rURW2aCYSXCrjtEyBdkicmG0EG0PicyicTwBJhYWCOl1XxBWlu8GnV0qbn39QpA/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'星在线',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/IicH2WIKxfLNt2AhEDEdpKNRW6kApLB6rDfEG8mOpR65Vgb4oRU81LhqqdTBAwXx53XkfRMngxNucKnSicfaawIw/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'笑对人生',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/KMc3ic26tfHomiaov8Vv5icJDzodibRkAsCia46icbzAc9jnacZcv1e4icWbFica6fUH66Q4Ric6QXp5SJXBRkyR9aIalsA/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'A.YANG',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/r678e0l92ogicnKH2fdSQEU5GsViaZxQVkS2xlhZyFakDCMMGE9vZB6Pr89nronYJ9IhQJibHy1NjY0AzrBoxAu7w/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'Superman',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/gHluXVXRkz3EA1OzSQQFdrf7KoLAQCl1iaqFic1JKszEzfPEib6lcwIdGDGA2zs4ouzdAFolrrWBHX30g76T0n0BQ/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'林泽楠',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83eotEDGibMU4f1nv9OC4QV2EjBDtD3NWDdiaDFJVs7pG6V1YyhvtAX0NiceiazvEHAYoQ9V7y7eT2vcDHw/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'努力奋斗',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83eowB44AADB37M5UBWrkY1IC6trjB6xaemjTejIdscOwc3tAeu0EKgIbb5Uy3DpErhBliak55YDjAmA/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'随遇而安',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/mRtBlsicVuErqIAibYwk97Vfe3R33bZhzCv3EcFjPS9AKudjTo6RqqzgerRJ6WHlBS1XJJmOAsYGclQs2vh8iaLLw/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'流年若景',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/ic7CadZv0meH8BoVL9tnZKszUTShIUKOTDXyZHicib8TvRByicxOKwDBp1E9dQtpYG0zsZdUKnDZ3nDgvYkQsufCEQ/132'
        );

        $arr[] = array(
            'money'=>'5.00',
            'nickname'=>'好日子',
            'avatarurl'=>'https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTI7gvy1l62mEfYrcQPrPwIxia88m2Z1Q28hCl0gcywmOLTK5kWyf366iayF5wicaqeLvVod71NnoStibg/132'
        );


        foreach ($result as $val){

            $arr[] = $val;

        }


        foreach ($arr as $key=>$val1){

            $arr[$key]['title'] = '成功提现'.$arr[$key]['money'].'元';

        }

        $redis->set('lyricist_cash',$arr,3600*24);

        return $arr;
    }

}